﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LibraryManagement.Custom_Controls
{
    public partial class libMasterForm : libForm
    {
       
        public libMasterForm()
        {
            InitializeComponent();
        }

        private void libButton1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnNew_Click(object sender, EventArgs e)
        {
            btnEdit.Enabled = false;
            txtName.Enabled = true;
            lsbMaster.Enabled = false;
            btnSave.Enabled = true;
            txtName.Clear();
        }

        private void btnEdit_Click(object sender, EventArgs e)
        {
            btnNew.Enabled = false;
            lsbMaster.Enabled = false;
            txtName.Enabled = true;
            btnSave.Enabled = true;
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            btnNew.Enabled = true;
            btnEdit.Enabled = true;
            lsbMaster.Enabled = true;
        }

        public void btnClear_Click(object sender, EventArgs e)
        {
            txtName.Clear();
            txtName.Enabled = false;
            btnEdit.Enabled = true;
            btnSave.Enabled = true;
            btnNew.Enabled = true;
            lsbMaster.Enabled = true;
        }

        public void libMasterForm_Load(object sender, EventArgs e)
        {
            txtName.Enabled = false;
            btnSave.Enabled = false;
        }

        public TextBox txt1 { get; set; }
        public List<TextBox> TextBoxCollection { get; set; }
    }
}
